<?php
//require_once(dirname(__FILE__) . '/../core/mmw_core_ApplicationRegistry.php');
require_once(dirname(__FILE__) . '/../mapper/mmw_mapper_WebpageMapper.php');
require_once(dirname(__FILE__) . '/../domain/mmw_domain_Webpage.php');

$url='whatever4.com';
$title="whatever";

$webpage=new mmw_domain_Webpage();
$webpage->setUrl($url);
$webpage->setTitle($title);

$webpageMapper=new mmw_mapper_WebpageMapper();

$webpageMapper->insert($webpage);

echo "inserting new webpage with \$url='$url' and \$title='$title'. Created with id=".$webpage->getId()."<br />";

$webpage2=$webpageMapper->findByUrl($url);

echo "testing function findByUrl with \$url='$url'. var_dump result:<br />";
var_dump($webpage2);

echo 'testing function delete with $id='.$webpage->getId();
$webpageMapper->delete($webpage->getId());

    

?>
